<script>
	export let photos, errors, values;
</script>

<h1>Photos</h1>

<div class="photos">
	{#each photos as photo}
		<figure>
			<a sveltekit:prefetch href="/photos/{photo.id}">
				<img src={photo.thumbnailUrl} alt={photo.title} /></a
			>
			<figcaption>{photo.title}</figcaption>
		</figure>{/each}
</div>

<style>
	.photos {
		width: 100%;
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		grid-gap: 8px;
	}

	figure,
	img {
		width: 100%;
		margin: 0;
	}
</style>
